<template>
	<view class="uni-padding-wrap">
		<view class="uni-list">
			<view class="uni-form-item uni-row">
				<view class="title">国家/地区</view>
				<view class=""></view>
				<view class="uni-list-cell-db">
					<picker @change="bindPickerChange" :value="index" :range="array">
						<view class="uni-input">{{array[index]}}</view>
					</picker>
				</view>
			</view>
		</view>
		<view class="uni-form-item uni-row">
			<view class="title">手机号</view>
			<input class="uni-input" focus placeholder="请输入手机号" @input="inputPhone"/>
			<a href="" class="href">获取验证码</a>
		</view>
		<view class="uni-form-item uni-row phone">
			<view class="title">验证码</view>
			<input class="uni-input" focus placeholder="请输入验证码" @input="inputCode"/>
		</view>
		<view class="uni-form-regbtn">
			<button type="primary" class="register-btn" @click="toReset()">重置密码</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				array: ['中国', '美国', '巴西', '日本'],
				index: 1,
				phone: '',
				code: ''
			}
		},
		methods: {
			bindPickerChange: function(e) {
				this.index = e.detail.value
			},
			inputPhone(e){
				this.phone = e.detail.value
				console.log("phone:",this.phone)
			},
			inputCode(e){
				this.code = e.detail.value
				console.log("code:",this.code)
			},
			toReset() {
				uni.navigateTo({
					// 路由跳转
					url: '../../pages/reset/reset',
					// 进行逻辑判断
					success: res => {
					},
					fail: () => {},
					complete: () => {}
				});
			}
		},
		onShow() {
			// uni.setNavigationBarTitle({
			// 	title: "找回密码"
			// })
			uni.setNavigationBarColor({
				backgroundColor: "#0b9eff",
				frontColor: "#ffffff"
			})
		}
	}
</script>

<style lang="scss">
	.uni-form-item {
		border-bottom: 1px solid #D9D9D9;
	}
	.uni-row {
		input {
			text-align: left;
		}
		.title {
			line-height: 60upx;
			text-align: left;
			width: 160upx;
		}
		.href {
			color: green;
			line-height: 80upx;
			text-decoration: none;
			margin-right: 20upx;
		}
		.href:active {
			color: #aaaaff;
		}
	}
	.uni-form-regbtn {
		width: 612upx;
		margin: 0 auto;
		margin-top: 64upx;
	}
</style>